package com.wudd.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wudd.entity.dto.OrderInfoDto;
import com.wudd.exception.MyHandlerException;
import com.wudd.service.OrderInfoService;
import com.wudd.service.remote.user.UserClient;

import org.apache.commons.lang3.StringUtils;

@Service
public class OrderInfoServiceImpl implements OrderInfoService{
	private static final Logger logger = LoggerFactory.getLogger(OrderInfoServiceImpl.class);

	@Autowired
	private UserClient userClient;

	@Override
	public int addOrderInfo() {
		String userName = userClient.getUserNameById("NO123").getData();
		logger.info("获取用户名:userName={}",userName);
		return 1;
	}

	@Override
	public int updateOrderInfo(OrderInfoDto orderInfo) {
		if(StringUtils.isBlank(orderInfo.getShopId())) {
			throw new MyHandlerException("店铺Id为空！");
		}
		return 1;
	}
}
